'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/api/git', controller.home.index);
  router.get('/', controller.home.index2);
  app.router.resources('topics', '/api/v2/topics', app.controller.topics);
  app.router.resources('administor', '/api/administor', app.controller.administor);
  app.router.resources('users', '/api/users', app.controller.users);
  app.router.resources('comments', '/api/comments', app.controller.comments);
  app.router.resources('course', '/api/course', app.controller.course);
  app.router.resources('courseCategory', '/api/courseCategory', app.controller.courseCategory);
  app.router.resources('info', '/api/info', app.controller.info);
  app.router.resources('messages', '/api/messages', app.controller.messages);
  app.router.resources('orderList', '/api/orderList', app.controller.orderList);
  app.router.resources('packages', '/api/packages', app.controller.packages);
  app.router.resources('questionAnswer', '/api/questionAnswer', app.controller.questionAnswer);
  app.router.resources('questions', '/api/questions', app.controller.questions);
  app.router.resources('slides', '/api/slides', app.controller.slides);
  app.router.resources('upvote', '/api/upvote', app.controller.upvote);
  app.router.resources('userCourse', '/api/userCourse', app.controller.userCourse);
  app.router.resources('video', '/api/video', app.controller.video);
  app.router.post('/api/upload', app.controller.common.upload);
};
